﻿#pragma once


// CDoubleList 对话框

class CDoubleList : public CDialogEx
{
	DECLARE_DYNAMIC(CDoubleList)

public:
	CDoubleList(CWnd* pParent = nullptr);   // 标准构造函数
	virtual ~CDoubleList();

// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_DIALOG1 };
#endif

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 支持

	DECLARE_MESSAGE_MAP()

private:
	char** m_pFileData = NULL;       //数据
	TCHAR *m_pFileFullPath;           //文件路径
	CString* m_pTreeItemText;         //树控件选择的项

private:
	//根据RVA计算FA
	DWORD RVATOFA(DWORD dwRVA);

    //将数字转换为字符串
    CString IntToString(DWORD nData, DWORD nLen);

	//清空列表
	void ClearUpListCtrl();
	void ClearDownListCtrl();

	//导入表添加表头
	void UpListInsertColumn();
	void DownListInsertColumn();

	//导出表添加表头 
	void UpListInsertExport();
	void DownListInsertExport();

	//重定位表添加表头
	void UpListInsertReloc();
	void DownListInsertReloc();

	//展示导入表项
	void ShowImportItem();

	//展示导出表项
	void ShowExportItem();

	//展示重定位目录
	void ShowReloctionItem();

	//展示函数名称等信息
	void ShowFunNameAlso(DWORD dwCount);

public:
	void SetFileData(char** pFileData);
	void SetFilePath(TCHAR* pFilePath);
	void SetTreeItemText(CString *pTreeItem);

public:

	void ShowImportTable();

	void ShowExportTable();

	void ShowReloctionTable();

public:
	CListCtrl m_UpListCtrl;
	CListCtrl m_DownListCtrl;
	virtual BOOL OnInitDialog();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnItemchangedList1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnClickList1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnClickList2(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRclickList1(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnAddimport();
};
